<template>
	<view v-if="!wxCheckType" class="com-add-btn" :class="{'safe-area-inset-bottom':safeAreaInsetBottom}" :style="{
			backgroundColor:bgColor,
			bottom: `${bottom}`,
			right: `${right}`,
			}" @tap="addHandle">
		<u-icon :name=" icon" color="#fff" size="64"></u-icon>
	</view>
</template>

<script>
	import {
		mapState,
	} from 'vuex'
	export default {
		props: {
			bgColor: {
				type: String,
				default: '#276AEE'
			},
			icon: {
				type: String,
				default: 'plus'
			},
			safeAreaInsetBottom: {
				type: Boolean,
				default: true
			},
			bottom: {
				type: String,
				default: '88rpx'
			},
			right: {
				type: String,
				default: '40rpx'
			},
		},
		data() {
			return {}
		},
		methods: {
			addHandle(e) {
				this.$emit('click', e)
			}
		},
		computed: {
			...mapState(['wxCheckType']),
		}
	}
</script>

<style lang="scss" scoped>
	.com-add-btn {
		position: fixed;
		bottom: 0;
		width: 112rpx;
		height: 112rpx;
		border-radius: 200rpx;
		box-shadow: 0rpx 16rpx 32rpx 0rpx rgba(22, 63, 169, 0.4);
		z-index: 999;

		transition: right .25s;

		display: flex;
		justify-content: center;
		align-items: center;

		&.safe-area-inset-bottom {
			margin-bottom: constant(safe-area-inset-bottom);
			margin-bottom: env(safe-area-inset-bottom);
		}
	}
</style>